package digui;

public class Fibo3 {
    static int fibo3(int n){
        if (n <= 2) return 1;
        int[] arr = new int[n + 1];
        arr[1]=arr[2]=1;
        for (int i = 3; i <= n; i++) {
            arr[i] = arr[i-1] + arr[i-2];
        }
        return arr[n];
    }



    public static void main(String[] args) {
        System.out.println(fibo3(3));
        System.out.println(fibo3(4));
        System.out.println(fibo3(5));
        System.out.println(fibo3(6));
        System.out.println(fibo3(7));
        System.out.println(fibo3(8));
    }
}
